package com.bnd.config;

import com.bnd.common.manager.GenericChatSessionManager;
import com.bnd.domain.session.WsChatSession;
import com.bnd.domain.session.WsChatSessionV2;
import com.bnd.service.CharacterInfoService;
import com.bnd.service.ChatHistoryService;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ChatSessionManagerConfig {
    /**
     * wsChatSessionV2聊天会话管理器
     */
    @Bean("wsChatSessionV2Manager")
    public GenericChatSessionManager<WsChatSessionV2> wsChatSessionV2Manager(
            CharacterInfoService characterInfoService,
            ChatHistoryService chatHistoryService,
            AiConfig aiConfig) {
        return new GenericChatSessionManager<>(characterInfoService, chatHistoryService, aiConfig);
    }

    /**
     * wsChatSession聊天会话管理器
     */
    @Bean("wsChatSessionManager")
    public GenericChatSessionManager<WsChatSession> wsChatSessionManager(
            CharacterInfoService characterInfoService,
            ChatHistoryService chatHistoryService,
            AiConfig aiConfig) {
        return new GenericChatSessionManager<>(characterInfoService, chatHistoryService, aiConfig);
    }

    /**
     * chatSession聊天会话管理器
     */
    @Bean("chatSessionManager")
    public GenericChatSessionManager<WsChatSession> chatSessionManager(
            CharacterInfoService characterInfoService,
            ChatHistoryService chatHistoryService,
            AiConfig aiConfig) {
        return new GenericChatSessionManager<>(characterInfoService, chatHistoryService, aiConfig);
    }
}
